The present invention relates to an electronic control having a floating-point data check function.
Electronic control units (ECU) used for a vehicle engine control or the like performs various operations such as calculations using fixed-point data. A floating-point processor (FPU) is recently used to enable calculations using floating-point data. Floating-point data yields calculation results with higher accuracy than fixed-point data.
Floating-point data is configured in compliance with the IEEE 754 standard. The floating-point data, as shown in FIG. 17A, has a one-bit sign part, an eight-bit exponent part, and a 23-bit mantissa part. Four-byte floating-point data (single-precision storage format) having a mantissa part of 23 bits has a resolution of seven digits (0.0000001).
FIG. 17B shows a bit pattern in single-precision storage format. A floating-point data is distinguished or divided into normalized numbers (values), denormalized numbers, infinite numbers, zero, and Not a Number (NaN, that is, non-numeric) by combinations of the exponent part and the mantissa part. Numbers other than non-numeric denote numeric values and non-numeric denotes that the numbers are not numeric. For example, non-numeric is used to indicate calculation results that cannot be represented as numeric values, such as 0/0, +∞ −∞.
The floating-point data has a data format of non-numeric. Once non-numeric is generated within the electronic control unit, it may propagate within the unit. Furthermore, all the results of, e.g., arithmetic calculations including non-numeric is non-numeric and become invalid. For example, comparisons about whether non-numeric is equal to or greater than or smaller than 1 produce a false result in either case. Therefore, the accuracy of calculation result (output value) cannot be guaranteed entirely, when non-numeric occurs within the electronic control unit.
Non-numeric may be generated in engine control primarily under two conditions. First, during calculation of the electronic control unit or battery backup, a RAM value of the floating-point type may change due to noise and the RAM value itself may change to non-numeric. For example, a floating-point RAM value may change to FFFFFFFFh (all one bits) due to noise. Second, arguments used in floating-point calculations may change due to noise or for other reasons, and non-numeric may be generated secondarily as a result of a calculation such as 0/0.
Specifically, in the case of fuel injection control, a fuel injection amount f is calculated as f=Fbase×fHL, with Fbase being a basic fuel injection amount calculated as integer data and fHL being a load compensation value calculated as floating-point data. In this calculation, if the load compensation value fHL is non-numeric, the value of a fuel injection amount f resulting from the calculation also becomes non-numeric, making normal fuel injection impossible.